#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool containsDuplicate(vector<int>& nums) {
        if (nums.size() < 2) return false;
        unordered_map<int, int> hash; // <nums[i],i>
        for (int x : nums)
        {
            if (hash.count(x)) return true;
            else hash[x]++;
        }
        return false;
    }
};